package com.xiaoshuidi.cloud.module.report.dal.mapper.bigdata;

import com.xiaoshuidi.cloud.framework.mybatis.core.mapper.BaseMapperX;
import com.xiaoshuidi.cloud.module.report.controller.bigdata.vo.ApartmentHouseStateStatisticsVO;
import com.xiaoshuidi.cloud.module.report.controller.bigdata.vo.ContractRentDistributionVO;
import com.xiaoshuidi.cloud.module.report.controller.bigdata.vo.CustomerAgeIntervalStepVO;
import com.xiaoshuidi.cloud.module.report.dal.DO.ApartmentDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 租赁数据概览 Mapper
 *
 * @author sxx
 */
@Mapper
public interface RentalDataMapper extends BaseMapperX<ApartmentDO> {

    /**
     * 公寓id 获取房态统计
     *
     * @return
     */
    ApartmentHouseStateStatisticsVO getHouseStateStatisticsByAptId(@Param("apartmentId")Long apartmentId);


    /**
     * 房源各类型设备统计
     * @param apartmentId
     * @return
     */
    List<Map<String,Object>> groupHouseDeviceByAptId(@Param("apartmentId")Long apartmentId);


    /**
     * 租金分布
     *
     * @param apartmentId 公寓id
     * @return {@link ContractRentDistributionVO}
     */
    ContractRentDistributionVO contractRentDistributionByAptId(@Param("apartmentId")Long apartmentId);


    /**
     * 付款流出占比
     *
     * @param apartmentId 公寓id
     * @return {@link ContractRentDistributionVO}
     */
    ContractRentDistributionVO paymentProportionByAptId(@Param("apartmentId")Long apartmentId);

    /**
     * 入住人年龄分布
     * @param apartmentId
     * @return
     */
    CustomerAgeIntervalStepVO customerAgeIntervalStepByAptId(@Param("apartmentId")Long apartmentId);


}
